from django.db import models

# Create your models here.

class UserInfo(models.Model):
    name = models.CharField(max_length=32)
    password = models.CharField(max_length=64)
    age = models.IntegerField()

    # 修改表需要设置默认值
    # age2 = models.IntegerField(default=2)
    # age3 = models.IntegerField(null=True,blank=True)
# 新增表直接写类
class Department(models.Model):
    title = models.CharField(max_length=32)

# 新建数据
# Department.objects.create(title="销售部")

# UserInfo.objects.create(name="xingxingru",password="123",age=18)